import { Reducer } from 'umi';

export interface BaseModelState {
}

export interface BaseModelType {
  reducers: {
    updateState: Reducer<BaseModelState>;
  };
}

/**
 * 基础Model，方便其他业务Model继承该对象，减少额外的代码
 */
const baseModel: BaseModelType = {
  reducers: {
    updateState(state, { payload }) {
      console.info(payload);
      return {
        ...state,
        ...payload
      }
    }
  }
}

export {
  baseModel
}